import { fileURLToPath } from 'url';

import { defineConfig } from 'vite';
import vue from '@vitejs/plugin-vue';
import vueJsx from '@vitejs/plugin-vue-jsx';
import tailwindcss from '@tailwindcss/vite';

import pkg from './package.json';

// https://vitejs.dev/config/
export default defineConfig({
  server: {
    port: 6088,
    host: '0.0.0.0',
  },
  plugins: [vue(), vueJsx(), tailwindcss()],
  resolve: {
    alias: {
      '@': fileURLToPath(new URL('./src', import.meta.url)),
    },
  },
  define: {
    __APP_ENV__: {
      __APP_VERSION__: pkg.version,
      __APP_NAME__: pkg.name,
    },
  },
});
